#!/usr/bin/env python
#    prop_exci_aorpa
#    ---------------
#    Molecule:         H2O
#    Wave Function:    SCF (AO-RPA through AO-SOPPA module)
#    Test Purpose:     Calculation of excitation energies through ABACUS

import os
import sys

sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from runtest_dalton import Filter, TestRun

test = TestRun(__file__, sys.argv)

f = Filter()


f.add(from_string = 'Cartesian Coordinates',
      num_lines = 8,
      rel_tolerance = 1.0e-8)

f.add(string = 'Number of coordinates in each symmetry',
      rel_tolerance = 1.0e-2)
      
f.add(string = 'Number of orbitals in each symmetry',
      rel_tolerance = 1.0e-2)

# Energy
f.add(string = 'Final HF energy',
      rel_tolerance = 1.0e-9)
f.add(string = 'Total MP2   energy',
      rel_tolerance = 1.0e-9)

# Silly as it is, this string appear twice in 
# paralllel calculations, causing the tests to fail
#f.add(string = 'AO integral driven SOPPA',

# Property calculation
f.add(string = 'Frequencies',
      rel_tolerance = 1.0e-5)

f.add(from_string = 'Perturbation symmetry',
      num_lines = 4,
      rel_tolerance = 1.0e-2)

f.add(string = 'SOPPA results')

f.add(from_string = 'Frequency dependent polarizabilities',
      num_lines = 43,
      abs_tolerance = 1.0e-5)

test.run(['prop_alpha_aosoppa.dal'], ['prop_alpha_aosoppa.mol'], f={'out': f},
         )

sys.exit(test.return_code)
